﻿@model Easy.Web.CMS.Widget.WidgetPart
<div @(Model.Widget.StyleClassResult(true))
     id="widget_@Model.Widget.ID"
     data-widgetid="@Model.Widget.ID">
    <div class="zoneToolbar @(Model.Widget.LayoutID.IsNullOrEmpty() ? "blue" : "green")">
        <div class="tools clearfix">
            <div class="pull-left">
                <span class="sort-handle">
                    <i class="glyphicon glyphicon-move ">
                    </i>
                    @Model.Widget.WidgetName
                </span>
            </div>
            <div class="pull-right">
                @if (Model.Widget.LayoutID.IsNullOrEmpty())
                {
                    <a href="@Url.Action("Edit", "Widget", new {module = "admin", ID = Model.Widget.ID})"><i class="glyphicon glyphicon-edit"></i></a>
                    <a href="javascript:void(0)" class="delete"
                       data-url="@Url.Action("DeleteWidget", "Widget", new {module = "admin"})"
                       data-id="@Model.Widget.ID"><i class="glyphicon glyphicon-trash"></i></a>
                }
            </div>
        </div>
    </div>
    @{
        Html.RenderPartial(Model.Widget.PartialView, Model.ViewModel);
    }
</div>